var path = require('path');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var VueLoaderPlugin = require('vue-loader/lib/plugin');
module.exports = {
	// mode: 'development',
	entry: './src/main.js',
	output: {
		filename: 'bundle.js',
		path: path.join(__dirname, '/dist')
	},
	plugins: [
		new HtmlWebpackPlugin({
			template: path.join(__dirname, './src/index.html'),
			favicon: path.resolve('favicon.ico') // 新增
		}),
		new VueLoaderPlugin()
	],
	module: {
		rules: [
			{test: /\.css$/, use: ['style-loader', 'css-loader']},
			{test: /\.less$/, use: ['style-loader', 'css-loader', 'less-loader']},
			{test: /\.jpg|jpeg|png|gif$/, use: 'url-loader?limit=9000'},
			{test: /\.js$/, use: 'babel-loader', exclude: /node_modules/},
			{test: /\.vue$/, use: 'vue-loader'},
			{test: /\.(eot|woff2?|ttf|svg)$/, use: 'url-loader'}
		]
	}
}